﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v2.16.0                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class EduComment : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<EduComment, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string CourseId { get; set; }
        public string TeacherId { get; set; }
        public string MemberId { get; set; }
        public string Nickname { get; set; }
        public string Avatar { get; set; }
        public string Content { get; set; }
        public byte IsDeleted { get; set; }
        public DateTime GmtCreate { get; set; }
        public DateTime GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<EduComment> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("edu_comment");

                entityBuilder.HasComment("评论");

                entityBuilder.HasIndex(e => e.CourseId, "idx_course_id");

                entityBuilder.HasIndex(e => e.MemberId, "idx_member_id");

                entityBuilder.HasIndex(e => e.TeacherId, "idx_teacher_id");

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .IsFixedLength(true)
                    .HasComment("讲师ID");

                entityBuilder.Property(e => e.Avatar)
                    .HasMaxLength(255)
                    .HasColumnName("avatar")
                    .HasComment("会员头像");

                entityBuilder.Property(e => e.Content)
                    .HasMaxLength(500)
                    .HasColumnName("content")
                    .HasComment("评论内容");

                entityBuilder.Property(e => e.CourseId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("course_id")
                    .HasDefaultValueSql("''")
                    .HasComment("课程id");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasComment("逻辑删除 1（true）已删除， 0（false）未删除");

                entityBuilder.Property(e => e.MemberId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("member_id")
                    .HasDefaultValueSql("''")
                    .HasComment("会员id");

                entityBuilder.Property(e => e.Nickname)
                    .HasMaxLength(50)
                    .HasColumnName("nickname")
                    .HasComment("会员昵称");

                entityBuilder.Property(e => e.TeacherId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("teacher_id")
                    .HasDefaultValueSql("''")
                    .IsFixedLength(true)
                    .HasComment("讲师id");
        }

    }
}
